package com.zhangtai.modules.service.system;

import com.zhangtai.modules.entity.system.OrgGroupEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-08-10 11:29:24
 */

public interface OrgGroupService {

    @GetMapping("/findOrgGroupList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "keyword", required = false) String keyword,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    @GetMapping("/findOrgGroupPage")
    @ApiOperation(value = "原生分页查询")
    public PageResult queryPage(@RequestParam(value = "keyword", required = false) String keyword,
                                @RequestParam(value = "groupName", required = false) String groupName,
                                @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

//
//    @GetMapping("/getOrgList")
//    @ApiOperation(value = "获取角色下所有公司id")
//    List<Long> getOrgList(@RequestParam(value="roleId")List<Long> roleId);

    @GetMapping("/infoOrgGroup")
    @ApiOperation(value = "根据id查找")
    OrgGroupEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/saveOrgGroup")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody OrgGroupEntity entity);

    @PostMapping("/updateOrgGroup")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody OrgGroupEntity entity);

    @GetMapping("/deleteOneOrgGroup")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteOrgGroups")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

